package com.boluo.custom.service.impl;

import java.util.List;

import com.boluo.common.utils.DateUtils;
import com.boluo.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.boluo.custom.mapper.CusFollowMapper;
import com.boluo.custom.domain.CusFollow;
import com.boluo.custom.service.ICusFollowService;

import javax.annotation.Resource;

/**
 * 客户回访Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-17
 */
@Service
public class CusFollowServiceImpl implements ICusFollowService 
{
    @Resource
    private CusFollowMapper cusFollowMapper;

    /**
     * 查询客户回访
     * 
     * @param id 客户回访主键
     * @return 客户回访
     */
    @Override
    public CusFollow selectCusFollowById(Long id)
    {
        return cusFollowMapper.selectCusFollowById(id);
    }

    /**
     * 查询客户回访列表
     * 
     * @param cusFollow 客户回访
     * @return 客户回访
     */
    @Override
    public List<CusFollow> selectCusFollowList(CusFollow cusFollow)
    {
        return cusFollowMapper.selectCusFollowList(cusFollow);
    }

    /**
     * 新增客户回访
     * 
     * @param cusFollow 客户回访
     * @return 结果
     */
    @Override
    public int insertCusFollow(CusFollow cusFollow)
    {
        // 参数校验

        // 设置录入时间
        cusFollow.setCusEnterTime(DateUtils.getNowDate());
        // 设置录入人id
        cusFollow.setCusEnterPeopleId(SecurityUtils.getUserId());
        return cusFollowMapper.insertCusFollow(cusFollow);
    }

    /**
     * 修改客户回访
     * 
     * @param cusFollow 客户回访
     * @return 结果
     */
    @Override
    public int updateCusFollow(CusFollow cusFollow)
    {
        return cusFollowMapper.updateCusFollow(cusFollow);
    }

    /**
     * 批量删除客户回访
     * 
     * @param ids 需要删除的客户回访主键
     * @return 结果
     */
    @Override
    public int deleteCusFollowByIds(Long[] ids)
    {
        return cusFollowMapper.deleteCusFollowByIds(ids);
    }

    /**
     * 删除客户回访信息
     * 
     * @param id 客户回访主键
     * @return 结果
     */
    @Override
    public int deleteCusFollowById(Long id)
    {
        return cusFollowMapper.deleteCusFollowById(id);
    }
}
